<html>
<head>
    <link href="${ctx}/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">
    <link href="${ctx}/font-awesome/3.0.0/css/font-awesome.min.css" rel="stylesheet">
    <link href="${ctx}/bootstrap-table/1.12.0/bootstrap-table.min.css" rel="stylesheet">
    <script src="${ctx}/jquery/2.1.4/jquery.min.js"></script>
    <script src="${ctx}/bootstrap/3.3.7/js/bootstrap.min.js"></script>
    <script src="${ctx}/bootstrap-table/1.12.0/bootstrap-table.min.js"></script>

    <style>
        * {
            font-size: 12px;
        }

        [class^="col-"] {
            vertical-align: middle;
            line-height: 34px;
            min-height: 34px;
            margin-bottom: 12px;
        }

        .form-control {
            margin: 0;
        }

        .form-control-static {
            min-height: 34px;
            padding: 0;
            margin-bottom: 0;
        }

        .align-right {
            text-align: right;
            padding-right: 0;
        }

        input {
            padding-left: 15px;
        }

        .line_box {
            display: table;
            width: 100%;
        }
    </style>

</head>
<body style="height: 290px; overflow-y: hidden;">
<#if role??>
    <div class="line_box">
        <div class="col-xs-3 align-right">ID：</div>
        <div class="col-xs-8">
            <p class="form-control-static">${role.roleId}</p>
        </div>
    </div>
</#if>
<div class="line_box">
    <div class="col-xs-3 align-right">角色名称：</div>
    <div class="col-xs-8">
        <input class="form-control" id="title" value="<#if role??>${role.title}</#if>">
    </div>
</div>
<div class="line_box">
    <div class="col-xs-3 align-right">备注信息：</div>
    <div class="col-xs-8">
        <textarea line_boxs="5" class="form-control" id="remark"
                  style="height: 100px"><#if role??>${role.remark}</#if></textarea>
    </div>
</div>
<div class="line_box">
    <button id="save_btn" style="margin-left:157px" type="button" class="btn btn-primary">保存</button>
</div>

<script>
    $(function () {
        $("#save_btn").click(function () {
            if (confirm("确定保存？")) {
                $.post("/role/save", {
                    roleId: <#if role?? && role.roleId??>'${role.roleId}'<#else>''</#if>,
                    title: $("#title").val(),
                    parentId: $("#parentId").val(),
                    remark: $("#remark").val()
                }, function (res) {
                    alert(res);
                    window.parent.iw.closeDialog();
                });
            }
        });
    });
</script>
</body>
</html>
